/*
 * PagerResponse.java
 * business
 *
 * Created by ChenTao on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.response;

import com.google.gson.annotations.SerializedName;
import com.yidiandao.business.data.net.BaseResponse;

/** 分页加载的Response */
public class PagerResponse extends BaseResponse {

    /** 当前数据是否是最后一条 */
    public static final int IS_END = 1;

    /** 分页的页面信息 */
    @SerializedName("pagination")
    private Pagination pagination;

    public boolean hasMoreData() {
        return getPagination().getIsEnd() != PagerResponse.IS_END;
    }

    public Pagination getPagination() {
        return pagination;
    }

    public void setPagination(Pagination pagination) {
        this.pagination = pagination;
    }

    public static class Pagination {

        @SerializedName("total")
        private int total;

        @SerializedName("isEnd")
        private int isEnd;

        @SerializedName("page")
        private int page;

        @SerializedName("pageSize")
        private int pageSize;

        public int getTotal() {
            return total;
        }

        public void setTotal(int total) {
            this.total = total;
        }

        public int getIsEnd() {
            return isEnd;
        }

        public void setIsEnd(int isEnd) {
            this.isEnd = isEnd;
        }

        public int getPage() {
            return page;
        }

        public void setPage(int page) {
            this.page = page;
        }

        public int getPageSize() {
            return pageSize;
        }

        public void setPageSize(int pageSize) {
            this.pageSize = pageSize;
        }
    }
}
